package com.comven.example.srouce.util;

/**
 * @author: xiongxin
 * @create: 2022/9/23 17:04
 * @desc: 线程变量
*/

public class DataSourceContextHodler {
	
	private static final ThreadLocal<String> contextKey = new ThreadLocal<>();
	
	public static void setContextKey(String value) {
		contextKey.set(value);
	}
	
	/**
	 * 获取当前线程key
	 */
	public static String getContextKey(){
		return contextKey.get();
	}
	
	public static void clear(){
		contextKey.remove();
	}
}
